package com.huangliusong.desigin.pattern.creational.singleton;

/**
 * @author huangliusong
 * @since 2018/10/11
 * {@link }
 */
public class ThreadLocalInstance {
    private static final ThreadLocal<ThreadLocalInstance> th=
            new ThreadLocal<ThreadLocalInstance>(){
                @Override
                protected ThreadLocalInstance initialValue() {
                    return new ThreadLocalInstance();
                }
            };

    private ThreadLocalInstance() {

    }

    public static ThreadLocalInstance getInstance(){
        return  th.get();
    }
}
